<?php
/**
 * Created by PhpStorm.
 * User: fangwei
 * Date: 2019-06-25
 * Time: 14:57
 */

namespace App\Http\Requests\Admin;


use Illuminate\Foundation\Http\FormRequest;

class DepartmentInputDTO extends FormRequest
{
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'name' => 'required|max:20',
            'parent_id' => 'integer',
        ];
    }

    public function messages()
    {
        return [
            'name.required' => '部门名称必须填写',
            'name.max' => '部门名称不能超过20个字符',
            'parent_id.integer' => '参数错误',
        ];
    }
}